import request from './request'

export function login(params) {
  return request({
    url: 'share/system/login',
    method: 'post',
    params
  })
}

export function token(data) {
  return request({
    url: 'share/system/token',
    method: 'post',
    data
  })
}

export function search(data) {
  return request({
    url: 'share/platform-service/shareUser/search',
    method: 'post',
    data
  })
}

export function saveOrUpdate(data,action) {
  return request({
    url: 'share/platform-service/shareUser/'+action,
    method: 'post',
    data
  })
}

export function getById(params) {
  return request({
    url: 'share/platform-service/shareUser/findUserById/'+params,
  })
}

export function resetPassword(params) {
  return request({
    url: 'share/platform-service/shareUser/resetPassword',
    method: 'put',
    params
  })
}

export function close(params) {
  return request({
    url: 'share/platform-service/shareUser/close',
    method: 'put',
    params
  })
}
export function open(params) {
  return request({
    url: 'share/platform-service/shareUser/open',
    method: 'put',
    params
  })
}

export function authenticate(data) {
  return request({
    url: 'share/auth-service/oauth/authenticate',
    method: 'post',
    data
  })
}

export function getMyself() {
  return request({
    url: 'share/platform-service/shareUser/getMyself',
  })
}

